package org.v2ray.rocket.proxy.support.base

import android.annotation.SuppressLint
import android.app.Application
import android.content.Context
import org.v2ray.rocket.proxy.support.network.RxHttpConfig

open class BaseApplication : Application() {

    companion object {

        const val FOREGROUND = 0//前台
        const val BACKGROUND = 1//后台

        @SuppressLint("StaticFieldLeak")
        lateinit var context: Context
        var processStatus: Int = FOREGROUND
    }

    override fun onCreate() {
        super.onCreate()
        context = this
        // 初始化RxHttp
        RxHttpConfig.provideRxHttpPlugins(this)
    }

    override fun attachBaseContext(base: Context?) {
        super.attachBaseContext(base)
        context = this
    }
}